package lanqiao;

import java.util.Arrays;

public class test7 {
    //1602 出现最多的字符
    public static void main(String[] args) {
        String str="FFEEFEAAECFFBDBFBCDA\n" +
                "DACDEEDCCFFAFADEFBBA\n" +
                "FDCDDCDBFEFCEDDBFDBE\n" +
                "EFCAAEECEECDCDECADDC\n" +
                "DFAEACECFEADCBFECADF\n" +
                "DFBAAADCFAFFCEADFDDA\n" +
                "EAFAFFDEFECEDEEEDFBD\n" +
                "BFDDFFBCFACECEDCAFAF\n" +
                "EFAFCDBDCCBCCEADADAE\n" +
                "BAFBACACBFCBABFDAFBE\n" +
                "FCFDCFBCEDCEAFBCDBDD\n" +
                "BDEFCAAAACCFFCBBAAEE\n" +
                "CFEFCFDEEDCACDACECFF\n" +
                "BAAAFACDBFFAEFFCCCDB\n" +
                "FADDDBEBCBEEDDECFAFF\n" +
                "CDEAFBCBBCBAEDFDBEBB\n" +
                "BBABBFDECBCEFAABCBCF\n" +
                "FBDBACCFFABEAEBEACBB\n" +
                "DCBCCFADDCACFDEDECCC\n" +
                "BFAFCBFECAACAFBCFBAF";
        int[] arr=new int[6];
        for (int i = 0; i < str.length(); i++) {
            char c=str.charAt(i);
            if(c=='A'){
                arr[0]++;
            }
            if(c=='B'){
                arr[1]++;
            }
            if(c=='C'){
                arr[2]++;
            }
            if(c=='D'){
                arr[3]++;
            }
            if(c=='E'){
                arr[4]++;
            }
            if(c=='F'){
                arr[5]++;
            }
        }
        Arrays.sort(arr);
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        System.out.println(arr[5]);
    }
}
